<%--
  Created by IntelliJ IDEA.
  User: 4S
  Date: 2021/11/9
  Time: 14:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<p>添加获奖经历</p>
    <table>
        <tr>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label"> 获奖名称</label>
                    <div class="layui-input-inline">
                        <input type="text" id="name" class="layui-input" placeholder="填写获奖名称" value="">
                    </div>
                </div>
            </td>
            <td>
                <div class="layui-inline">
                    <label class="layui-form-label">获奖时间</label>
                    <div class="layui-input-inline">
                        <input type="text" id="awardTime" class="layui-input" placeholder="yyyy-MM-dd"
                               value="">
                    </div>
                </div>
            </td>
        </tr>
    </table>
<button class="button_save" id="button_award_save_${award.id}" onclick="award_save()">保存并更新</button>
<button class="button_cancel" id="button_award_cancel">取消</button>
</body>
</html>
<script>

    function award_save(){
        let resumeId = $("#resumeId").val();
        let awardId = $("#awardId").val();
        let name = $("#name").val();
        let awardTime = $("#awardTime").val();
        let param = "resumeId=" + resumeId + "&name=" + name + "&awardTime=" + awardTime;
        console.log(param);
        $.post('/hire/resume/award/insert', param, function (res) {
            if (res.code == '200') {
                $("#award_info").load("/hire/resume/award_info", {id: resumeId});
                $("#award_edit").hide();
                $("#award_info").show();
            }
        })
    }
    $("#button_award_cancel").click(function () {
        let resumeId = $("#resumeId").val();
        // console.log($("#award_info"))
        $("#award_info").load("/hire/resume/award_info", {id: resumeId});
        $("#award_edit").hide();
        $("#award_info").show();
    })
    layui.use('laydate', function () {
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#awardTime'
        });
    });
</script>
